<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        div{
            width: 300px;
            height: 50px;
            background-color: black;
            margin: 10px;
        }
    </style>
</head>
<body>
   <div></div>
   <div></div>
   <div></div>
   <div></div>
   <div></div>

   <script>
    var oDiv = document.querySelectorAll("div");
    for(var i=0; i<oDiv.length; i++){
        oDiv[i].tag = true;
        oDiv[i].index = i;
        oDiv[i].onclick = function(){
            if(this.tag == true){
                oDiv[this.index].style.height = "80px";
                this.tag = false;
            }else{
                oDiv[this.index].style.height = "50px";
                this.tag = true;
            }
        }
    }
   </script>
</body>
</html>